<extend name="base"/>

<block name="main">
    <div class="sc-box">
        <div class="sb-tab">
            <div class="sbt-btn active" onclick="checkType(this, 1)">整套课程</div>
            <div class="sbt-btn" onclick="checkType(this, 2)">单个章节</div>
            <div class="clear"></div>
        </div>

        <div class="sb-list">
            <volist name="data" id="vo">
                <div class="sbl-box">
                    <a class="sblb-img" href="../../pages/course_page/course_page.html">
                        <img src='__HELPER_IMG__/img_pic2.jpg' mode="aspectFill"></img>
                    </a>
                    <div class="sblb-wz">
                        <label class="sblbw-bt">VR实景教学2019</label>
                        <label class="sblbw-js">共15节</label>
                        <div class="sblbw-qx">取消收藏</div>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
            </volist>
        </div>
    </div>
</block>

<block name="js">
    <script>
        var url = 'Apis/videoCollectList';
        var param = {};
        var check_type;

        function checkType(that, type)
        {
            check_type = type;

            $('.sbt-btn').removeClass('active');
            $(that).addClass('active');

            $.showLoading('数据加载中');

            scroll(0, 0);//滚动条滑动至最顶端
            initLoad();

            var uid = '{$Think.session.uid}';

            param.uid = uid;
            param.type = check_type;
            param.page = page;

            post_ajax(url, param, function (res) {
                if (res.result == 1) {
                    var list = res.data;

                    var html = readerHtml(list);
                    $('.sb-list').html(html);
                } else {
                    $('.sb-list').html('');
                    layer.msg(res.msg);
                }
            })
        }

        function readerHtml(list)
        {
            var html = '';
            if (list.length > 0) {
                list.forEach(function (val) {

                })
            }
            return html;
        }
    </script>
</block>

